<?php
session_start();
$user=$_SESSION['user'];

if (!empty($user)){
	
	$conexion=mysql_connect("localhost", "root", "") or die ("Error al Conectar!");
	mysql_select_db("hazarte") or die ("Verifique la Base de Datos");
	
	$sql = "SELECT COUNT(*) FROM  `usuarios` WHERE  `usuario` =  '$user'";
	$resultado = mysql_query($sql);
	$msg = mysql_fetch_row($resultado);
	
	if  ($msg[0] == 1){

		?>
		<!doctype html>
		<html  lang =  "es">
			<head>
				<meta charset="utf-8">
				<meta name="autor" content="jaimelopez">
				<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
				
				<link href="../libs/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
				<link href="../css/estilo.css" rel="stylesheet" type="text/css">
		
				<script src="../libs/jquery/jquery_1.11.js" type="text/javascript"></script> 
				<script src="../libs/bootstrap/js/bootstrap.js" type="text/javascript"></script>
				<script src="../js/funcionalidad.js" type="text/javascript"></script> 
			    
			</head>
				
			<body id="bodyClass">
				<div class="col-md-8 col-md-offset-2">
					<div class="page-header" style="text-align:center;">
						<h2>Administraci&oacute;n Haz Arte</h2>
					</div>
				</div>
				<div class="col-md-4 col-md-offset-4" >
				<p>En este panel de administraci&oacuten se puede A&ntilde;adir fotos y Eliminar fotos</p><br>
					 <a href="addFoto.php" class="btn btn-primary btn-lg">A&ntilde;adir foto</a>
					 <a href="deleteFoto.php" class="btn btn-primary btn-lg" style="float:right">Eliminar foto</a>
				</div>
			</body>
		</html>	
	
<?php 
	}else{
		header('Location: error.html');
	}
}else{
	header('Location: error.html');
}

?>


